﻿--use PolePosition
GO

IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'up_UtilityAssetXMissionStructuresPoles_SelectIdList')
	DROP PROCEDURE up_UtilityAssetXMissionStructuresPoles_SelectIdList
GO

CREATE PROCEDURE up_UtilityAssetXMissionStructuresPoles_SelectIdList
	 @UtilityFk int 
	,@SearchByType varchar(50) = null
	,@SearchByText varchar(50) = null
AS

SET NOCOUNT ON	



DECLARE @IdList varchar(MAX)
SET @IdList = ''


SELECT 
	 @IdList = @IdList + CONVERT(varchar, [Utility_Asset_XMissionStructures_PoleId]) + ','
FROM v_tb_Utility_Asset_XMissionStructures_Poles Pole
INNER JOIN tb_Utility_Asset_XMissionStructures Structure
	ON Structure.Utility_Asset_XMissionStructureId = Pole.Utility_Asset_XMissionStructureFK
WHERE Structure.UtilityFK = @UtilityFk

SELECT @IdList


GO

